package daos;

import javax.persistence.EntityManager;

import Facade.AcademicoFacade;

import entidades.AbstractEntity;

public class AbstractDAO<E extends AbstractEntity> {

	EntityManager manager;
	
	public AbstractDAO(EntityManager manager){
		this.manager = manager;
	}
	
	public void salvar (E entity){
		manager.persist(entity);
	}
	
	
	public void remover (E entity){
		manager.remove(entity);
	}
	
	public Class<E> entityClass(){
		return null;
	}
	
	public E buscarPorId (Long id){
		return manager.find(entityClass(), id);
		
	}
	
}











